﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using mvcDemo.Models;

namespace mvcDemo.Controllers
{

    public class TypesByRemarkController : ApiController
    {
        
        // GET api/typesbyremark
        public JsonMessage Get(int id)
        {
            try
            {
                using (Entities db = new Entities())
                {
                    List<TYPEREMARK> types = db.TYPEREMARK.Where(a => a.REMARKID == id).ToList();
                    return new JsonMessage(types);
                }
            }
            catch (Exception ex)
            {
                return new JsonMessage("获取资源失败！", ex.Message, ex.StackTrace);
            }
        }
       
    }
}
